<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../_Config.asp" -->
<!--#include file="../_Utils.asp" -->
<%
Session.CodePage=65001

MchOrderNo = Request("mchOrderNo")
Amount = Request("amount")
AccountName = Request("accountName")
AccountNo = Request("accountNo")
Remark = Request("remark")


IF IsEmpty(MchOrderNo) Or IsEmpty(Amount) Or IsEmpty(AccountName) Or IsEmpty(AccountNo) Or IsEmpty(Remark) Then
	response.Write("丢失参数")
	response.end()
End If

Amount = Amount * 100  '元转换为分

Dim ParamsDict
set ParamsDict=CreateObject("Scripting.Dictionary")

ParamsDict.Add "mchId", MchId   '商户ID
ParamsDict.Add "mchOrderNo", MchOrderNo   '商户代付单号
ParamsDict.Add "amount", Amount   ' 代付金额（单位分）
ParamsDict.Add "accountAttr", "0"   '账户属性:0-对私,1-对公,默认对私
ParamsDict.Add "accountName", AccountName   ' 收款人账户名
ParamsDict.Add "accountNo", AccountNo   ' 收款人账户号
ParamsDict.Add "province", ""   '开户行所在省份
ParamsDict.Add "city", ""   ' 开户行所在市
ParamsDict.Add "bankName", ""   '开户行名称
ParamsDict.Add "bankNumber", ""   '联行号
ParamsDict.Add "notifyUrl", "http://localhost/api/agpay/Notify.asp"   '转账结果回调URL
ParamsDict.Add "remark", Remark   '备注
ParamsDict.Add "extra", ""   '扩展域
ParamsDict.Add "reqTime", GetNowDateStr4Append()   '请求时间, 格式yyyyMMddHHmmss
ParamsDict.Add "version", "1.0"   '版本号, 固定参数1.0

'Md5加密，生成摘要信息
Sign=ParamsDictSign(ParamsDict, MchKey)
ParamsDict.Add "sign", Sign

'请求支付网关并将数据原样返回页面
response.Write PostHTTPPage( (PayHost & "/api/agentpay/apply" ), GetUrlStr(ParamsDict))

%>
